package com.example.annatation;

import com.example.demo.controller.TestController;

public enum TestEnum {

    TEST("/test/index", TestController.class);

    private String type;
    private Class<?> desc;

    private TestEnum(String type, Class<?> desc) {
        this.type = type;
        this.desc = desc;
    }

    public static Class<?> getClass(String type) {
        TestEnum[] TestEnums = values();
        for (TestEnum testEnum : TestEnums) {
            if (testEnum.getType().equals(type)) {
                return testEnum.getDesc();
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Class<?> getDesc() {
        return desc;
    }

    public void setDesc(Class<?> desc) {
        this.desc = desc;
    }
}
